# uncompyle6 version 3.2.3
# Python bytecode 3.6 (3379)
# Decompiled from: Python 3.6.8 |Anaconda custom (64-bit)| (default, Feb 21 2019, 18:30:04) [MSC v.1916 64 bit (AMD64)]
# Embedded file name: broker\scan_session_job_helpers.py
import copy, logging
from sqlalchemy import func as sql_func
from sqlalchemy import or_ as sql_or
from db.tables.scan_session_jobs import ScanSessionJobRow, ScanSessionJobsTable
from db.tables.scan_sessions import ScanSessionRow, ScanSessionsTable
from db import Connection
from db.tables.targets import TargetRow, TargetsTable
from settings_provider import settings

logger = logging.getLogger("broker.jobs")


class AbortReason:
    user_deleted = "user_deleted"
    scan_deleted = "scan_deleted"
    abort_requested = "abort_requested"
    scan_timeout = "scan_timeout"
    start_timeout = "start_timeout"
    excluded_hours = "excluded_hours"
    network_scan_only = "network scan only"
    user_disabled = "user_disabled"
    license_error = "license error"
    user_not_validated = "user_not_validated"
    too_many_web_scans = "max web scans count reached"
    target_verification_failed = "target verification failed"
    pause_expired = "pause_expired"


class JobConstants:
    status_crashed = "crashed"
    status_processing = "processing"
    status_starting = "starting"
    status_aborted = "aborted"
    status_aborting = "aborting"
    worker_not_found = "worker_not_found"
    not_found = "job_not_found"
    start_failed = "start_failed"
    no_more_workers = "no_more_workers"


class CheckDeltaT:
    aborting = 15
    pausing = 15
    on_error_recheck = 30
    processing = 30
    starting = 60
    default = 60
